package com.wish.client;

import com.wish.datastructure.CircleArray;
import com.wish.inter.datastructure.IBasicArray;

/**
 * Created by suliucheng on 2021/3/30 20:32
 * Directions:
 */
public class CircleArrayClient {
    public static void main(String[] args) {
        int maxSize = 8;
        IBasicArray circleArray = new CircleArray(maxSize);
        boolean empty = circleArray.isEmpty();
        System.out.println("初始一个环形队列,最大容量为:"+maxSize+",空内存用0表示,内存为空？"+empty);
        System.out.println("推进1个元素得到：");
        circleArray.push();
        circleArray.show();

        System.out.println("再推进3个元素得到：");
        circleArray.push(3);
        circleArray.show();

        System.out.println("再推进3个元素得到：");
        circleArray.push(3);
        circleArray.show();

        System.out.println("弹出3个元素得到：");
        circleArray.pop(3);
        circleArray.show();

        System.out.println("再推进1个元素得到：");
        circleArray.push();
        circleArray.show();

        System.out.println("再推进1个元素得到：");
        circleArray.push();
        circleArray.show();

        System.out.println("再推进1个元素得到：");
        circleArray.push();
        circleArray.show();

        System.out.println("再推进1个元素得到：");
        circleArray.push();
        circleArray.show();

        System.out.println("弹出1个元素得到：");
        circleArray.pop();
        circleArray.show();
    }
}
